import request from '@/utils/request'

// 获取所有角色
export const getRoleListAPI = () => {
  return request.get('/role/list')
}

// 新增角色
export const addRoleAPI = (data: { name: string; description?: string,functionIds: number[] ,menuIds: number[]}) => {
  return request.post('/role/insert', data)
}

// 更新角色
export const updateRoleAPI = (data: { id: number; name: string; description?: string,functionIds: number[] ,menuIds: number[] }) => {
  return request.put('/role/update', data)
}

// 删除角色
export const deleteRoleAPI = (id: number) => {
  return request.delete(`/role/delete/${id}`)
}

// 批量删除角色
export const batchDeleteRoleAPI = (integers: number[]) => {
  return request.delete('/role/deleteBatch', { data: integers })
}
